<template>
  <div id="app">
    <v-header :seller="seller"></v-header>
    <div class="tab border-1px">
      <router-link tag="div" class="tab-item" :to="{path: '/goods'}">商品</router-link>
      <router-link tag="div" class="tab-item" :to="{path: '/ratings'}">评论</router-link>
      <router-link tag="div" class="tab-item" :to="{path: '/seller'}">商家</router-link>
    </div>
   <router-view :seller="seller"></router-view>
  </div>
</template>
<script>
// new 测试
// 测试

import Header from './components/header/header'

const ERR_OK = 0
export default {
  data () {
    return {
      seller: {}
    }
  },
  created () {
    this.$http.get('api/seller').then((res) => {
      if (res.data.errno === ERR_OK) {
        this.seller = res.data.data
      }
    })
  },
  components: {
    'v-header': Header
  }
}
</script>

<style lang="stylus" rel="stylesheet/stylus">
@import '~common/stylus/mixin'
  .tab
    width 100%
    display flex
    height 40px
    line-height 40px
    border-1px(rgba(7, 17, 21, 0.1))
    .tab-item
      flex 1
      text-align center
      display block
      font-size 14px
      color rgb(77, 85, 93)
    .router-link-active
      color rgb(240, 20, 20)
</style>
